<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />  
    <meta name="viewport" content="width=device-width, initial-scale=1">
    
    <link rel="stylesheet" href="./css/bootstrap.css"> 
    <link rel="stylesheet" href="./css/common.css">
    <link rel="stylesheet" href="./css/news.css">

    <script src="./js/jquery-3.4.1.min.js"></script>  
    <script src="./js/bootstrap.js"></script>
    <script src="./js/template-web.js"></script>
    <script src="./js/ajax.js"></script>
    <title>关于我们-猎狐人才资源服务有限公司</title>
    
</head>
<body>
    <div class="wrap">
        <script type="text/javascript" src="./js/head.js"></script>

    <div id="ss" class="container-fluid row">
          <!-- <div class="caption">
            <h3>新闻中心</h3>
            <p class="site"><em class="icon-icon__dot"></em>您的位置 : <a href="https://www.sanguosha.com">官网首页</a>><a href="javascript:;">新闻</a>>新闻列表</p>
          </div> -->
        <div class="article">
            <ul class="article-nav">
              <li class="on"><a href="https://www.sanguosha.com/Home/newsList/id/1000">综合</a><em></em></li>
              <li ><a href="https://www.sanguosha.com/Home/newsList/id/1001">资讯</a><em></em></li>
              <li ><a href="https://www.sanguosha.com/Home/newsList/id/1002">活动</a><em></em></li>
              <li ><a href="https://www.sanguosha.com/Home/newsList/id/1003">公告</a></li>
            </ul>
            <ul class="article-list" id="article">

<script type="text/html" id="artList">
    {{each data}}
    <li>
        <a href="#" target="_blank">
            <p class="article-name">{{$value.title}}</p><p class="article-time">{{$value.time}}</p>
        </a>
    </li>
    {{/each}}
</script>

            </ul>
        </div>
    </div>
<div class="page">
    <a href="/Home/newsList/id/1000/curPage/1" class="prev-page page-stop">
        <em class="icon1"></em>上一页
    </a>
            <a href="#" class="page-stop curPage">&nbsp;1&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/2">&nbsp;2&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/3">&nbsp;3&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/4">&nbsp;4&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/5">&nbsp;5&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/6">&nbsp;6&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/7">&nbsp;7&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/8">&nbsp;8&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/9">&nbsp;9&nbsp;</a>
              <a href="/Home/newsList/id/1000/curPage/10">&nbsp;10&nbsp;</a>
    <a href="/Home/newsList/id/1000/curPage/2" class="next-page ">
        下一页<em class="icon2"></em>
    </a>
    <em class="jumpPage">跳转到</em>
    <input type="text" name="page" id="page" value="1"/>
    <em class="jumpPage">页/228页</em>
    <a href="#" onclick="gotoPage()">前往</a>
</div>

        </div> 

    <div class="empty"></div>
    </div>
    <script type="text/javascript" src="./js/foot.js"></script>
</body>
</html>
<script type="text/javascript">
    //转到指定的页面
    var gotoPage = function(){
        var pageNum = parseInt($('#page').val());
        console.log(pageNum)
        var totalPage = 228;
        totalPage = parseInt(totalPage);
        if (pageNum === '' || isNaN(pageNum) || pageNum <= 0){
            alert('请输入一个正整数！');
            $('#page').val('1');
        } else {
            if (pageNum > totalPage) pageNum = totalPage;
            var url = "/Home/newsList/id/1000/curPage/" + pageNum;
            window.location = url;
        }
    }

    var artList=document.getElementById("artList");
    var article=document.getElementById("article");
    ajax({
        type: 'get',
        url: 'https://www.fastmock.site/mock/c7327ab6314451e5c1e086c21415702c/test/news',
        data: {},
        dataType: "json",
        success: function (data) {
            var result=data.data;
            var html = template('artList', {data: result});
            article.innerHTML= html;

            console.log(result);
        }
    });
    
</script>      